import req from '@/http/http'
import {getServer} from '@/http/AppApi'

let ZHPQ_SERVER = getServer()

// 民情日志
export const createFolkLog = data => {
  let path = '/folkLog/'
  return req.post(path, data)
}

export const deleteFolkLog = data => {
  let path = '/folkLog/' + data.id
  return req.delete(path, data)
}

export const updateFolkLog = data => {
  let path = '/folkLog/' + data.id
  return req.put(path, data)
}

export const findFolkLog = param => {
  let path = '/folkLog'
  return req.get(path, param)
}

export const findCheckFolkLog = param => {
  let path = '/folkLog/check'
  return req.get(path, param)
}

export const updateCheckFolkLog = data => {
  let path = '/checkFolkLog/' + data.id
  return req.put(path, data)
}
export const getFolkLog = id => {
  let path = '/folkLog/' + id
  return req.get(path)
}

export const getSignList = param => {
  let path = '/SignInfo'
  return req.get(path, param)
}

export const updateRecommend = data => {
  let path = '/folkLog/recommendation/' + data.id
  return req.put(path, data)
}

// 获取角色
export const getRole = _ => {
  let path = '/roles/u/list'
  return req.get(path)
}

// 详情
export const findCruise = _ => {
  let path = ZHPQ_SERVER + '/SignInfo/getUser'
  return req.get(path)
}
// 巡格列表
export const findCruisePage = param => {
  let path = ZHPQ_SERVER + '/SignInfo/patrolByQuery'
  return req.get(path, param)
}
// 巡格次数
export const findCruiseTimes = param => {
  let path = ZHPQ_SERVER + '/SignInfo/getPatrol'
  return req.get(path, param)
}
// 巡格预览
export const getCruiseTrack = param => {
  let path = ZHPQ_SERVER + '/SignInfo/getPatrolDetail'
  return req.get(path, param)
}
